-
Notifications
You must be signed in to change notification settings - Fork 46.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix act
bundle size regression
#19832
Fix act
bundle size regression
#19832
Conversation
Adds back the `TestUtils.act` implementation that I had removed in facebook#19745. This version of `act` is implemented in "userspace" (i.e. not the reconciler), so it doesn't add to the production bundle size. I had removed this in facebook#19745 in favor of the `act` exported by the reconciler because I thought we would remove support for `act` in production in the impending major release. (It currently warns.) However, we've since decided to continue supporting `act` in prod for now, so that it doesn't block people from upgrading to v17. We'll drop support in a future major release. So, to avoid bloating the production bundle size, we need to move the public version of `act` back to "userspace", like it was before. This doesn't negate the main goal of facebook#19745, though, which was to decouple the public version(s) of `act` from the internal one that we use to test React itself.
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 62105de:
|
Details of bundled changes.Comparing: ec39a5e...62105de react-dom
ReactDOM: size: 🔺+6.4%, gzip: 🔺+5.8% Size changes (experimental) |
Details of bundled changes.Comparing: ec39a5e...62105de react-dom
ReactDOM: size: 🔺+6.4%, gzip: 🔺+5.8% Size changes (stable) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
¯\(ツ)/¯
Adds back the `TestUtils.act` implementation that I had removed in facebook#19745. This version of `act` is implemented in "userspace" (i.e. not the reconciler), so it doesn't add to the production bundle size. I had removed this in facebook#19745 in favor of the `act` exported by the reconciler because I thought we would remove support for `act` in production in the impending major release. (It currently warns.) However, we've since decided to continue supporting `act` in prod for now, so that it doesn't block people from upgrading to v17. We'll drop support in a future major release. So, to avoid bloating the production bundle size, we need to move the public version of `act` back to "userspace", like it was before. This doesn't negate the main goal of facebook#19745, though, which was to decouple the public version(s) of `act` from the internal one that we use to test React itself.
Adds back the `TestUtils.act` implementation that I had removed in facebook#19745. This version of `act` is implemented in "userspace" (i.e. not the reconciler), so it doesn't add to the production bundle size. I had removed this in facebook#19745 in favor of the `act` exported by the reconciler because I thought we would remove support for `act` in production in the impending major release. (It currently warns.) However, we've since decided to continue supporting `act` in prod for now, so that it doesn't block people from upgrading to v17. We'll drop support in a future major release. So, to avoid bloating the production bundle size, we need to move the public version of `act` back to "userspace", like it was before. This doesn't negate the main goal of facebook#19745, though, which was to decouple the public version(s) of `act` from the internal one that we use to test React itself.
Adds back the
TestUtils.act
implementation that I had removed in #19745. This version ofact
is implemented in "userspace" (i.e. not the reconciler), so it doesn't add to the production bundle size.I had removed this in #19745 in favor of the
act
exported by the reconciler because I thought we would remove support foract
in production in the impending major release. (It currently warns.)However, we've since decided to continue supporting
act
in prod for now, so that it doesn't block people from upgrading to v17. We'll drop support in a future major release.So, to avoid bloating the production bundle size, we need to move the public version of
act
back to "userspace", like it was before.This doesn't negate the main goal of #19745, though, which was to decouple the public version(s) of
act
from the internal one that we use to test React itself.